Configure VRRP on a Port or a VLAN

Configure VRRP on a port or a VLAN to forward packets to the virtual IP addresses associated with the virtual router and customize the VRRP configuration.

Before you begin

  • Create primary and, optionally, Secondary IP Interfaces on the VLAN.

  • Configure the VRRP version on the interface.

About this task

You can create secondary virtual IP addresses for VRRP instances on VLAN interfaces using the same ip vrrp address command included in this procedure. The first address you configure is the primary virtual IP address. Secondary virtual IP addresses must be in the same subnet as a Secondary IP Interface on the VLAN.

Procedure

  1. Enter Interface Configuration mode:

    enable

    configure terminal

    interface GigabitEthernet {slot/port[/sub-port][-slot/port[/sub-port]][,...][slot/all][all]} or interface vlan <1–4059>

    Note

    Note

    If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

  2. Configure a primary virtual address and create the VRRP instance:

    ip vrrp address <1-255> {A.B.C.D}

  3. Optional: Create a secondary virtual IP address:
    Note

    Note

    This step does not apply to brouter ports.

    ip vrrp address <1-255> {A.B.C.D}

  4. Enable the VRRP instance:

    ip vrrp <1-255> enable

  5. Show the global VRRP configuration:

    show ip vrrp

Example

Switch:1>enable 
Switch:1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch:1(config)#interface gigabitethernet 1/2

Configure a primary VRRP address:

Switch:1(config-if)#ip vrrp address 28 192.0.2.1 

Enable VRRP:

Switch:1(config-if)#ip vrrp 28 enable 

Variable Definitions

Use the data in the following table to use the ip vrrp command.

Variable

Value

1-255

Specifies the number of the VRRP to create or modify.

action {none|preempt}

Specifies the action of the VRRP interface:

  • none—do not override the holddown timer
  • preempt—override the holddown timer
Note:

You can use this parameter only if the holddown timer is active.

address <1-255> {A.B.C.D}

Configures the IP address of the VRRP physical interface that forwards packets to the virtual IP addresses associated with the virtual router.

A.B.C.D is the IP address of the master VRRP.

adver-int <1-255>

Configures the the time interval (in seconds) between sending VRRP advertisement messages. The default is 1.

This value must be the same on all participating routers.

backup-master enable

Enables the VRRP backup master.

When backup master functionality is enabled, the VRRP router forwards IP packets destined to the VRRP MAC even when the router is not the VRRP Master.

Important:

Do not enable backup master if you enable critical IP.

critical-ip-addr <A.B.C.D>

Configures the critical IP address for VRRP.

A.B.C.D is the IP address on the local router, which is configured so that a change in its state causes a role switch in the virtual router (for example, from master to backup) in case the interface stops responding.
Note:

In this context, local implies an address from the same VRF as the IP interface where VRRP is being configured.

critical-ip enable

Enables the critical IP address option.

Important:

Do not enable Critical IP if backup master is enabled.

enable

Enables VRRP on the port.

fast-adv enable

Enables the Fast Advertisement Interval. The default is disabled.

fast-adv-int <200-1000>

Configures the Fast Advertisement Interval, the time interval between sending VRRP advertisement messages.

200-1000 is the range in milliseconds, and must be the same on all participating routers. The default is 200. You must enter values in multiples of 200 milliseconds.

holddown-timer <0-21600>

Specifies the time interval (in seconds) to wait before preempting the current VRRP primary router. The default is 0.

preempt-mode

Enables preempt mode for VRRP (v3).

priority <1-255>

Configures the port VRRP priority.

1-255 is the value used by the VRRP router. The default is 100. Assign the value 255 to the router that owns the IP address associated with the virtual router.